home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-04 | 1.7 KB | 75 lines | [TEXT/MPS ] |
- // UMouseDocument.cp
- // Copyright © 1992 by Apple Computer, Inc. All rights reserved.
- // Kent Sandvik DTS
- // This file contains the basic TMouseDocument member functions
- // Version Info (latest first):
- //
- // <1> khs 1.0 First final version
- // <2> khs 1.0.1 Fixed a memory leak in TMapApplication::GetSleepValue()
-
-
- // INCLUDES
- #ifndef __UMOUSEDOCUMENT__
- #include "UMouseDocument.h" // class definitions
- #endif
-
- #undef Inherited
- #define Inherited TDocument
-
- #pragma segment AInit
- DefineClass(TMouseDocument, Inherited);
-
- // CLASS METHODS
- // Empty constructor - for avoiding ptabs in global data space
- TMouseDocument::TMouseDocument()
- {
- }
-
-
- // Create TMouseDocument
- #pragma segment AInit
- void TMouseDocument::IMouseDocument()
- {
- Inherited::IDocument();
- }
-
-
- // Free any resources attached to the TMouseDocument - yes it's empty, but one never
- // knows if one could place something here, so I have it added. Yes, it wastes CPU
- // cycles...
- #pragma segment AClose
- void TMouseDocument::Free()
- {
- Inherited::Free();
- }
-
-
- // Create any needed TMouseDocument Views
- #pragma segment AOpen
- void TMouseDocument::DoMakeViews(Boolean /*forPrinting*/)
- {
- TWindow * aWindow = NULL;
- FailInfo fi;
-
- Try(fi)
- {
- // create main information window
- aWindow = (TWindow *)gViewServer->NewTemplateWindow(kMainWindow, this);
- fMainView = (TView *)aWindow->FindSubView('vie1');
-
- // add frame adorner for the document
- fMainView->AddAdorner(NewStdAdorner('afra', "", 'afra', kFreeOnDeletion), kDrawView, kRedraw);
-
- // add mouse tracking behaviors
- TMouseTrackBehavior * theBehavior = new TMouseTrackBehavior;
- theBehavior->IMouseTrackBehavior(mMouseTrack);
- this->AddBehavior(theBehavior);
-
- fi.Success();
- }
- else
- fi.ReSignal();
- }
-
-
-